import 'package:flutter/material.dart';

import '../../common/style/colors.dart';
/// 吐司布局
class ToastWidget extends StatelessWidget {
  final String content;

  const ToastWidget({Key? key, required this.content}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      maintainBottomViewPadding: true,
      child: Padding(
        padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
        child: DefaultTextStyle(
          style: const TextStyle(color: AppColors.white),
          child: Padding(
            padding: const EdgeInsets.all(16),
            child: Align(
              alignment:  const Alignment(0, 0.618),
              child: ClipRRect(
                borderRadius: BorderRadius.circular(4),
                child: Container(
                  color: AppColors.dialogBg,
                  padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
                  child: Text(content),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
